import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 0;
        String str1 = in.nextLine();
        String str2 = in.nextLine();
        for (int i = 0; i <= str1.length(); i++) {
            StringBuffer sb = new StringBuffer(str1);
            sb.insert(i,str2);
            StringBuffer tmp = new StringBuffer(sb);
            if(judge(tmp)){
                count++;
            }
        }
        System.out.print(count);
    }

    public static boolean judge (StringBuffer str) {
        return str.toString().equals(str.reverse().toString());
    }
}